# Maintainer : Mike Krüger <mikekrueger81@gmail.com>

pkgname=swagarch-settings-manager
pkgver=0.5.5
pkgrel=2
pkgdesc="SwagArch GNU/Linux System Settings Tool"
arch=('i686' 'x86_64')
url="https://gitlab.com/SwagArch/swagarch-settings-manager"
license=('GPL3')
depends=('icu' 'qt5-base' 'hwinfo' 'kitemmodels' 'kauth' 
         'kcoreaddons' 'ckbcomp' 'xdg-utils')
makedepends=('git' 'extra-cmake-modules' 'kdoctools' 'qt5-tools'
             'knotifications' 'kconfigwidgets' 'kcmutils')
source=("git+$url.git")
sha256sums=('SKIP')

build() {
  cd "${srcdir}/${pkgname}"
  mkdir -p build
  cd build
  cmake ../ \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DLIB_INSTALL_DIR=lib \
    -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
    -DSYSCONF_INSTALL_DIR=/etc
  make
}

package() {
    #fix issue: Create "/usr/share/pixmaps/faces" directory #28
    rm -rf "${pkgdir}/usr/share/pixmaps/faces/"
    mkdir -p "${pkgdir}/usr/share/pixmaps/faces/"
    cd "${srcdir}/${pkgname}"
    cp -rf "${srcdir}/swagarch-settings-manager/faces" "${pkgdir}/usr/share/pixmaps/"

    cd "${srcdir}/${pkgname}/build"
    make DESTDIR=${pkgdir} install 
}
